from flask_restful import fields

movie_fields = {
    'mid' : fields.Integer,
    'show_name' : fields.String,
    'show_name_en':  fields.String,
    'director':  fields.String,
    'leading_role' : fields.String,
    'type':  fields.String,
    'country':  fields.String,
    'language' : fields.String,
    'duration' : fields.String,
    'screening_model' : fields.String,
    'open_day' : fields.DateTime(dt_format='iso8601'),
    'pic' : fields.String,
    'flag' : fields.Integer,
}

area_fields = {
    'aid' : fields.Integer,
    'parent_id' : fields.Integer,
    'short_name' : fields.String,
    'name' : fields.String,
    'merger_name' : fields.String,
    'level' : fields.String,
    'pinyin' : fields.String,
    'code' : fields.String,
    'zip_code' : fields.String,
    'first' : fields.String,
    'lng' : fields.String,
    'lat' : fields.String,
    'is_hot' : fields.Integer,
}

movies_fields = {
    'hot_count': fields.Integer,
    'will_count': fields.Integer,
    'hot_movies':fields.List(fields.Nested(movie_fields)),
    'will_movies':fields.List(fields.Nested(movie_fields))
}



normal_area = {
    'first': fields.String,
    'normal_list': fields.List(fields.Nested(area_fields))
}

areas_fields = {
    'hot_areas':fields.List(fields.Nested(area_fields)),
    # 'areas':fields.Nested(first_area_fields),
    'normal_areas':fields.List(fields.Nested(normal_area)),
}

data_fields = {
    'movie':fields.Nested(movies_fields),
    'area':fields.Nested(areas_fields),
}

result = {
    'status':fields.Integer,
    'msg':fields.String,
    'data':fields.Nested(data_fields)
}